package dave.hibernate.lab;


import java.sql.Date;
//import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.annotations.*;
import org.hibernate.tool.hbm2ddl.*;


@Entity
@Table (name="PATIENT", schema="test")
public class Patient{
	private Long id;
	private String firstName;
	private String lastName;
	private String address;
	private String city;
	private String state;
	private java.util.Date checkin;
	private java.util.Date checkout;
	private int total;
	private String dob;
	
	@Id
	@GeneratedValue
	@Column (name="ID")
	public Long getId(){
		return id;
	}
	public void setId(Long id){
		this.id = id;
	}
	@Column (name="FIRST_NAME")
	public String getFirstName(){
		return firstName;
	}
	
	@Column (name="FIRST_NAME")
	public void setFirstName(String firstName){
		this.firstName = firstName;
	}
	
	@Column (name="LAST_NAME")
	public String getLastName(){
		return lastName;
	}
	
	@Column (name="LAST_NAME")
	public void setLastName(String lastName){
		this.lastName = lastName;
	}
	
	@Column (name="DOB")
	public String getDOB(){
		return dob;
	}
	
	@Column (name="DOB")
	public void setDOB(String DOB){
		this.dob = dob;
	}
	
	@Column (name="ADDRESS")
	public String getAddress(){
		return address;
	}
	
	@Column (name="ADDRESS")
	public void setAddress(String address){
		this.address = address;
	}
	
	@Column (name="CITY")
	public String getCity(){
		return city;
	}
	
	@Column (name="CITY")
	public void setCity(String city){
		this.city = city;
	}
	
	
	@Column (name="STATE")
	public String getState(){
		return state;
	}
	
	@Column (name="STATE")
	public void setState(String state){
		this.state = state;
	}
	
	@Column (name="CHECK_IN")
	public java.util.Date getCheckin(){
		return checkin;
	}
	
	@Column (name="CHECK_IN")
	public void setCheckin(java.util.Date checkin){
		this.checkin = checkin;
	}
	
	@Column (name="CHECK_OUT")
	public java.util.Date getCheckout(){
		return checkout;
	}
	
	@Column (name="CHECK_OUT")
	public void setCheckout(java.util.Date checkout){
		this.checkout = checkout;
	}
	
	@Column (name="TOTAL")
	public int getTotal(){
		return total;
	}
	
	@Column (name="TOTAL")
	public void setTotal(int total){
		this.total = total;
	}
	
	
	public static void main(String[] args){
		//create a configuration object, reading from the hibernate.cf.xml file
		//Configuration config = new Configuration();
		Configuration config = new Configuration();
		//make sure hibernate aware of the User class
		config.addAnnotatedClass(Patient.class);
		//read and process hibernate.cfg.xml and JPA metadata
		config.configure();
		new SchemaExport(config).create(true,true);
	    
	}
}